const Axios = require('../utils/request');
const API = '/common';

// 获取省份信息
const getLocationInfo = params => {
  return Axios.http({url: API + '/getLocationInfo', data: params})
}
// 校验图形验证码
const checkCaptcha = params => {
  return Axios.http({url: API + '/captcha/checkCaptcha', data: params, method: 'POST'})
}
// 获取图形验证码
const getAppletCaptcha = params => {
  return Axios.http({url: API + '/captcha/getAppletCaptcha', data: params})
}
// 用户名密码登录
const passwordLogin = params => {
  return Axios.http({url: API + '/user/passwordLogin', data: params, method: 'POST'})
}
// 用户手机号登录
const phoneLogin = params => {
  return Axios.http({url: API + '/user/phoneLogin', data: params, method: 'POST'})
}
// 校验验证码
const checkSms = params => {
  return Axios.http({url: API + '/sms/checkSms', data: params, method: 'POST'})
}
// 发送验证码，未对接短信通道，默认发送123456
const sendSms = params => {
  return Axios.http({url: API + '/sms/sendSms', data: params, method: 'POST'})
}
// 公众号发送验证码
const sendGzhSms = params => {
  return Axios.http({url: API + '/sms/sendGzhSms', data: params, method: 'POST'})
}

module.exports = {
  getLocationInfo,
  checkCaptcha,
  getAppletCaptcha,
  passwordLogin,
  phoneLogin,
  checkSms,
  sendSms,
  sendGzhSms
}
